function ProductVideoDvdBluRay() {
};

ProductVideoDvdBluRay.instance = function(callbackFunc) {
  var popupBox = new PopupBox(), _self = this;
  
  var model = Model.instance('{{$smarty.const.MODEL_NAME_PRODUCT_VIDEODVD_BLURAY|escape:javascript}}', '{{$smarty.const.MODEL_TITLE_PRODUCT_VIDEODVD_BLURAY|escape:javascript}}', '{{$smarty.const.MODEL_TYPE_PRODUCT|escape:javascript}}');
  
  //Create model here...
  var state0 = State.instance(model, 0, 'not activate');
  var state1 = State.instance(model, 1, 'complete Final DVD');
  var state2 = State.instance(model, 2, 'post Final DVD');
  var state3 = State.instance(model, 3, 'receive Final DVD');
  var state4 = State.instance(model, 4, 'deliver Final DVD');
  var state5 = State.instance(model, 5, 'receive Final DVD');
  var state6 = State.instance(model, 6, 'CUS pick up product');
  var state7 = State.instance(model, 7, 'CUS picked up product');
  var state8 = State.instance(model, 8, 'translate and upload CUS requirement');
  var state9 = State.instance(model, 9, 'download CUS requirement');
  var state10 = State.instance(model, 10, 'product completed');
  var transition1 = Transition.instance('completed', state1, state2, '{{$smarty.const.USER_TYPE_FILM_CUTTER|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition2 = Transition.instance('sent', state2, state3, '{{$smarty.const.USER_TYPE_FILM_CUTTER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition3 = Transition.instance('received', state3, state4, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition4 = Transition.instance('sent', state4, state5, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition5 = Transition.instance('received', state5, state6, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition6 = Transition.instance('pick up', state6, state7, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition7 = Transition.instance('rmd CUS', state6, state6, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition8 = Transition.instance('product fault report', state7, state8, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition9 = Transition.instance('uploaded', state8, state9, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition10 = Transition.instance('downloaded', state9, state1, '{{$smarty.const.USER_TYPE_FILM_CUTTER|escape:javascript}}', DlmanageUtils.normal, 3);
  
  var transition11 = Transition.instance('completed', state1, state2, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition12 = Transition.instance('sent', state2, state3, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition13 = Transition.instance('received', state3, state4, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition14 = Transition.instance('sent', state4, state5, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition15 = Transition.instance('received', state5, state6, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition16 = Transition.instance('pick up', state6, state7, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition17 = Transition.instance('rmd CUS', state6, state6, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition18 = Transition.instance('product fault report', state7, state8, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition19 = Transition.instance('uploaded', state8, state9, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition20 = Transition.instance('downloaded', state9, state1, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  
  var transition21 = Transition.instance('completed', state1, state2, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition22 = Transition.instance('sent', state2, state3, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition23 = Transition.instance('received', state3, state4, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition24 = Transition.instance('sent', state4, state5, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition25 = Transition.instance('received', state5, state6, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition26 = Transition.instance('pick up', state6, state7, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition27 = Transition.instance('rmd CUS', state6, state6, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition28 = Transition.instance('product fault report', state7, state8, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition29 = Transition.instance('uploaded', state8, state9, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition30 = Transition.instance('downloaded', state9, state1, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  
  transition4.validate = function(produce, user, date, options) { return false; };
  transition5.validate = function(produce, user, date, options) { return false; };
  transition7.validate = function(produce, user, date, options) { if (transition7.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition14.validate = function(produce, user, date, options) { return false; };
  transition15.validate = function(produce, user, date, options) { return false; };
  transition17.validate = function(produce, user, date, options) { if (transition17.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition24.validate = function(produce, user, date, options) { return false; };
  transition25.validate = function(produce, user, date, options) { return false; };
  transition27.validate = function(produce, user, date, options) { if (transition27.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition6.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    options.stage = 4; 
                                                                                    options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                    DlmanageUtils.operate3(transition6, pos, callbackFunc, produce, user, date, options);
                                                                                  };
  
  transition8.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     produce.modified = 1;
                                                                                     DlmanageUtils.operate(transition8, pos, callbackFunc, produce, user, date, options);
                                                                                   };
                                                                                   
  transition16.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     options.stage = 4; 
                                                                                     options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                     DlmanageUtils.operate3(transition16, pos, callbackFunc, produce, user, date, options);
                                                                                   };
 
 transition18.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    produce.modified = 1;
                                                                                    DlmanageUtils.operate(transition18, pos, callbackFunc, produce, user, date, options);
                                                                                  };
transition26.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  options.stage = 4; 
                                                                                  options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                  DlmanageUtils.operate3(transition26, pos, callbackFunc, produce, user, date, options);
                                                                                };

transition28.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                   options = {};
                                                                                 }
                                                                                 var previous = MiscUtils.clone(produce);
                                                                                 options.previous = previous;
                                                                                 produce.modified = 1;
                                                                                 DlmanageUtils.operate(transition28, pos, callbackFunc, produce, user, date, options);
                                                                               };
  model.states = [ state0, state1, state2, state3, state4, state5, state6, state7, state8, state9, state10 ];
  model.transitions = [ transition1, transition2, transition3, transition4, transition5, transition6, transition7, transition8, transition9, transition10, transition11, transition12, transition13, transition14, transition15, transition16, transition17, transition18, transition19, transition20,
                        transition21, transition22, transition23, transition24, transition25, transition26, transition27, transition28, transition29, transition30];  return model;
};